#include <iostream>
#include <vector>
#include <algorithm>
#include <Vector.hpp>

using namespace std;

class Solution
{
public:
    vector<int> minCosts(vector<int> &cost)
    {
        if (cost.size() == 0 || cost.size() == 1)
            return cost;
        for (int i = 1; i < cost.size(); i++)
        {
            cost[i] = min(cost[i], cost[i - 1]);
        }
        return cost;
    }
};

int main()
{
    cout << "Code3502" << endl;
    Solution s;
    vector<int> cost = {5, 3, 4, 1, 3, 2};
    PrintVector(s.minCosts(cost));
    return 0;
}